package com.yadang.activemq;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.jms.core.JmsTemplate;

import javax.jms.ConnectionFactory;


/**
 * @author: 亚当
 * @date: 2023年04月05日 22:03
 * @package: com.yadang.activemq
 * @Description: TODO
 */
@Configuration
public class JmsConfig {
    @Autowired
    private ConnectionFactory connectionFactory;


    @Bean
    public JmsTemplate jmsTemplate(){
        JmsTemplate jmsTemplate = new JmsTemplate();
        jmsTemplate.setConnectionFactory(connectionFactory);
        jmsTemplate.setPubSubDomain(false);
        return jmsTemplate;
    }
}
